<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>

<link href="../style/css_qt.css" rel="stylesheet" type="text/css" />
<link href="../style/cssqt.css" rel="stylesheet" type="text/css" />

</head>

<body>

<?php
$idsuatl = $_GET["idsuatl"];
include("../config/config.php");
$matl = $_POST["matl"];
$tentl = $_POST["tentl"];

$lenh = "select * from theloai where matl='$idsuatl'";
$kq = mysql_query($lenh);
$row = mysql_fetch_array($kq);

if(isset($_POST["sua"]))
{
	$lenhsua = "update theloai set matl='$matl',tentl='$tentl' where matl='$idsuatl'";
	
	$kqsua = mysql_query($lenhsua);

if($kqsua)
{
	?>
    <script>
	alert('sửa thành công!');
	location.href='indexqt.php?act=ttintheloai';
	</script>
   <?php
  
	
}

}
?>
<form action="" method="post" enctype="multipart/form-data" name="formthem" id="formthem" >
  <table width="755" border="1" cellspacing="0" cellpadding="0" class="under_table_qt">
    <tr>
      <td height="50" colspan="2" align="center" bgcolor="#FFFF99" class="title_table_qt"><strong>SỬA THỂ LOẠI</strong></td>
    </tr>
    <tr>
      <td width="230" height="50" class="padding_left_qt" >Mã thể loại</td>
      <td width="364" height="50"><label for="matl"></label>
      <input name="matl" type="text" class="texte_field_qt"id="matl" placeholder="mã thể loại" readonly="readonly" value="<?php  echo $idsuatl   ?>" /></td>
    </tr>
    <tr>
      <td height="50" class="padding_left_qt" >Tên thể loại</td>
      <td height="50"><label for="tentl"></label>
      <input name="tentl" type="text" class="texte_field_qt"id="tentl" placeholder="tên thể loại" value="<?php  echo $row["tentl"];   ?>" /></td>
    </tr>
   
    <tr>
      <td height="50" colspan="2" align="center"><input name="sua" type="submit" class="button_qt" id="sua" value="SỬA THỂ LOẠI"  /></td>
    </tr>
  </table>
</form>

</body>
</html>